(0) Obligation:

Clauses:

f(c(s(X), Y)) :- f(c(X, s(Y))).
g(c(X, s(Y))) :- g(c(s(X), Y)).
h(X) :- ','(f(X), g(X)).

Query: h(g)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

fA(s(T18), T19) :- fA(T18, s(T19)).
gB(T28, s(T29)) :- gB(s(T28), T29).
hC(c(s(T8), T9)) :- fA(T8, T9).
hC(c(s(T8), T9)) :- ','(fA(T8, T9), gB(T8, T9)).

Query: hC(g)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
hC_in: (b)
fA_in: (b,b)
gB_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

hC_in_g(c(s(T8), T9)) → U3_g(T8, T9, fA_in_gg(T8, T9))
fA_in_gg(s(T18), T19) → U1_gg(T18, T19, fA_in_gg(T18, s(T19)))
U1_gg(T18, T19, fA_out_gg(T18, s(T19))) → fA_out_gg(s(T18), T19)
U3_g(T8, T9, fA_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))
U3_g(T8, T9, fA_out_gg(T8, T9)) → U4_g(T8, T9, gB_in_gg(T8, T9))
gB_in_gg(T28, s(T29)) → U2_gg(T28, T29, gB_in_gg(s(T28), T29))
U2_gg(T28, T29, gB_out_gg(s(T28), T29)) → gB_out_gg(T28, s(T29))
U4_g(T8, T9, gB_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))

Pi is empty.

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

hC_in_g(c(s(T8), T9)) → U3_g(T8, T9, fA_in_gg(T8, T9))
fA_in_gg(s(T18), T19) → U1_gg(T18, T19, fA_in_gg(T18, s(T19)))
U1_gg(T18, T19, fA_out_gg(T18, s(T19))) → fA_out_gg(s(T18), T19)
U3_g(T8, T9, fA_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))
U3_g(T8, T9, fA_out_gg(T8, T9)) → U4_g(T8, T9, gB_in_gg(T8, T9))
gB_in_gg(T28, s(T29)) → U2_gg(T28, T29, gB_in_gg(s(T28), T29))
U2_gg(T28, T29, gB_out_gg(s(T28), T29)) → gB_out_gg(T28, s(T29))
U4_g(T8, T9, gB_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))

Pi is empty.

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

HC_IN_G(c(s(T8), T9)) → U3_G(T8, T9, fA_in_gg(T8, T9))
HC_IN_G(c(s(T8), T9)) → FA_IN_GG(T8, T9)
FA_IN_GG(s(T18), T19) → U1_GG(T18, T19, fA_in_gg(T18, s(T19)))
FA_IN_GG(s(T18), T19) → FA_IN_GG(T18, s(T19))
U3_G(T8, T9, fA_out_gg(T8, T9)) → U4_G(T8, T9, gB_in_gg(T8, T9))
U3_G(T8, T9, fA_out_gg(T8, T9)) → GB_IN_GG(T8, T9)
GB_IN_GG(T28, s(T29)) → U2_GG(T28, T29, gB_in_gg(s(T28), T29))
GB_IN_GG(T28, s(T29)) → GB_IN_GG(s(T28), T29)

The TRS R consists of the following rules:

hC_in_g(c(s(T8), T9)) → U3_g(T8, T9, fA_in_gg(T8, T9))
fA_in_gg(s(T18), T19) → U1_gg(T18, T19, fA_in_gg(T18, s(T19)))
U1_gg(T18, T19, fA_out_gg(T18, s(T19))) → fA_out_gg(s(T18), T19)
U3_g(T8, T9, fA_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))
U3_g(T8, T9, fA_out_gg(T8, T9)) → U4_g(T8, T9, gB_in_gg(T8, T9))
gB_in_gg(T28, s(T29)) → U2_gg(T28, T29, gB_in_gg(s(T28), T29))
U2_gg(T28, T29, gB_out_gg(s(T28), T29)) → gB_out_gg(T28, s(T29))
U4_g(T8, T9, gB_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HC_IN_G(c(s(T8), T9)) → U3_G(T8, T9, fA_in_gg(T8, T9))
HC_IN_G(c(s(T8), T9)) → FA_IN_GG(T8, T9)
FA_IN_GG(s(T18), T19) → U1_GG(T18, T19, fA_in_gg(T18, s(T19)))
FA_IN_GG(s(T18), T19) → FA_IN_GG(T18, s(T19))
U3_G(T8, T9, fA_out_gg(T8, T9)) → U4_G(T8, T9, gB_in_gg(T8, T9))
U3_G(T8, T9, fA_out_gg(T8, T9)) → GB_IN_GG(T8, T9)
GB_IN_GG(T28, s(T29)) → U2_GG(T28, T29, gB_in_gg(s(T28), T29))
GB_IN_GG(T28, s(T29)) → GB_IN_GG(s(T28), T29)

The TRS R consists of the following rules:

hC_in_g(c(s(T8), T9)) → U3_g(T8, T9, fA_in_gg(T8, T9))
fA_in_gg(s(T18), T19) → U1_gg(T18, T19, fA_in_gg(T18, s(T19)))
U1_gg(T18, T19, fA_out_gg(T18, s(T19))) → fA_out_gg(s(T18), T19)
U3_g(T8, T9, fA_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))
U3_g(T8, T9, fA_out_gg(T8, T9)) → U4_g(T8, T9, gB_in_gg(T8, T9))
gB_in_gg(T28, s(T29)) → U2_gg(T28, T29, gB_in_gg(s(T28), T29))
U2_gg(T28, T29, gB_out_gg(s(T28), T29)) → gB_out_gg(T28, s(T29))
U4_g(T8, T9, gB_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 6 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GB_IN_GG(T28, s(T29)) → GB_IN_GG(s(T28), T29)

The TRS R consists of the following rules:

hC_in_g(c(s(T8), T9)) → U3_g(T8, T9, fA_in_gg(T8, T9))
fA_in_gg(s(T18), T19) → U1_gg(T18, T19, fA_in_gg(T18, s(T19)))
U1_gg(T18, T19, fA_out_gg(T18, s(T19))) → fA_out_gg(s(T18), T19)
U3_g(T8, T9, fA_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))
U3_g(T8, T9, fA_out_gg(T8, T9)) → U4_g(T8, T9, gB_in_gg(T8, T9))
gB_in_gg(T28, s(T29)) → U2_gg(T28, T29, gB_in_gg(s(T28), T29))
U2_gg(T28, T29, gB_out_gg(s(T28), T29)) → gB_out_gg(T28, s(T29))
U4_g(T8, T9, gB_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GB_IN_GG(T28, s(T29)) → GB_IN_GG(s(T28), T29)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(12) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GB_IN_GG(T28, s(T29)) → GB_IN_GG(s(T28), T29)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GB_IN_GG(T28, s(T29)) → GB_IN_GG(s(T28), T29)
    The graph contains the following edges 2 > 2

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FA_IN_GG(s(T18), T19) → FA_IN_GG(T18, s(T19))

The TRS R consists of the following rules:

hC_in_g(c(s(T8), T9)) → U3_g(T8, T9, fA_in_gg(T8, T9))
fA_in_gg(s(T18), T19) → U1_gg(T18, T19, fA_in_gg(T18, s(T19)))
U1_gg(T18, T19, fA_out_gg(T18, s(T19))) → fA_out_gg(s(T18), T19)
U3_g(T8, T9, fA_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))
U3_g(T8, T9, fA_out_gg(T8, T9)) → U4_g(T8, T9, gB_in_gg(T8, T9))
gB_in_gg(T28, s(T29)) → U2_gg(T28, T29, gB_in_gg(s(T28), T29))
U2_gg(T28, T29, gB_out_gg(s(T28), T29)) → gB_out_gg(T28, s(T29))
U4_g(T8, T9, gB_out_gg(T8, T9)) → hC_out_g(c(s(T8), T9))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FA_IN_GG(s(T18), T19) → FA_IN_GG(T18, s(T19))

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(19) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

FA_IN_GG(s(T18), T19) → FA_IN_GG(T18, s(T19))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(21) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • FA_IN_GG(s(T18), T19) → FA_IN_GG(T18, s(T19))
    The graph contains the following edges 1 > 1

(22) YES